function countDown(time) {
    let date = +new Date(); //现在的时间
    let inputTime = +new Date(time); //未来距离的时间
    let times = (inputTime - date) / 1000;//剩余时间
    if (times <= 0) {
        return;
    }
    let d = parseInt(times / 60 / 60 / 24); //天
    let h = (parseInt(times / 60 / 60 % 24) + '').padStart(2, '0');//小时
    let m = (parseInt(times / 60 % 60) + '').padStart(2, '0'); //分钟
    let s = (parseInt(times % 60) + '').padStart(2, '0');//秒
    let str = d + '天' + h + '时' + m + '分' + s + '秒';
    app.innerHTML = '五一倒计时' + str;
}
setInterval(function () {
    countDown('2021-5-1');
}, 1000)
